/* import axios from 'axios'
import qs from 'qs'
import Vue from 'vue'
import Cookies from 'js-cookie'
Vue.prototype.$ajax = axios
axios.defaults.timeout = 10000
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'
axios.defaults.withCredentials = true
axios.interceptors.request.use((config) => {
  // Indicator.open({
  //   text: '加载中...',
  //   spinnerType: 'fading-circle'
  // })
  //   console.log(config);
    console.log(Cookies.get('Token'))
    // let token = Cookies.get('token')
    // if (token) {
    //     config.headers = {
    //         'access-token': token
    //     }
    // }
    config.credentials = true;
  if (config.method === 'post') {
    if (Cookies.get('Token')) {
        config.data = {...config.data, token: Cookies.get('Token')}
    }
      config.data = qs.stringify(config.data)
  }
  return config
}, (error) => {
  return Promise.reject(error)
})
axios.interceptors.response.use((res) => {
  // Indicator.close()
    if (res.data.code == 302) {
      // Vue.$message.error('未登录')
    }
  return res
}, (error) => {
  console.log('好多人在访问呀，请重新试试[timeout]')
  if (error) {
    let errortime = null
    clearTimeout(errortime)
    errortime = setTimeout(() => {
      clearTimeout(errortime)
    }, 0)
  }
  return Promise.reject(error)
})
 */